/*
 * @lc app=leetcode.cn id=1446 lang=cpp
 *
 * [1446] 连续字符
 */

// @lc code=start
class Solution {
public:
    int maxPower(string s) {
        int res = 1;
        int cnt = 1;
        for(int i = 1; i < s.size(); i++)
        {
            if(s[i] == s[i - 1])
                cnt++;
            else
            {
                res = max(res, cnt);
                cnt = 1;
            }
        }
        return max(res, cnt);
    }
};
// @lc code=end

